Skip to content

fix(workflows): escape step-graph brackets in workflow info so the step type shows#3690

Merged
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:fix/workflow-info-step-graph-markup
Jul 23, 2026
Merged

fix(workflows): escape step-graph brackets in workflow info so the step type shows#3690
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:fix/workflow-info-step-graph-markup

Conversation

@jawwad-ali

Copy link
Copy Markdown
Contributor

What

specify workflow info <id> renders each step's line as → <id> [<type>] — with the step type meant to appear inside literal square brackets. But console.print has Rich markup enabled, so [<type>] is parsed as an opening style tag named after the step type (command, gate, prompt, …). Those aren't valid Rich styles and there's no closing tag, so Rich silently swallows the whole [<type>] token — every step prints as → <id> with the type gone.

Fix

Escape the literal bracket with \[ so Rich renders [<type>] verbatim, and escape the id/type through _escape_markup (as the sibling workflow_list already does for displayed fields). Mirrors the in-file \[disabled] precedent in workflow_list.

Tests

tests/test_workflows.py::TestWorkflowInfoStepGraph::test_step_type_rendered_in_literal_brackets — monkeypatches WorkflowEngine.load_workflow to return a definition with a gate step and asserts [gate] appears in workflow info output. Fails before the fix (output is → step-one — the [gate] swallowed). ruff clean.


AI-assisted: authored with Claude Code. Reproduced the Rich markup-swallowing behavior and verified fail-before/pass-after.

…type shows

`workflow info` rendered each step as `→ <id> [<type>]`, but console.print
has Rich markup enabled, so `[<type>]` was parsed as a style tag named after
the step type (command/gate/prompt/…) and silently swallowed — every step
printed as `→ <id> ` with the type gone.

Escape the literal bracket with `\[` (and escape id/type via _escape_markup,
as the sibling workflow_list does), so Rich renders `[<type>]` literally.
Mirrors the in-file `\[disabled]` precedent.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Rich markup handling so workflow info displays step types in literal brackets.

Changes:

  • Escapes step IDs, types, and literal brackets.
  • Adds regression coverage for [gate] rendering.
Show a summary per file
File Description
src/specify_cli/workflows/_commands.py Corrects step graph rendering.
tests/test_workflows.py Adds regression test.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Medium

@mnriem
mnriem merged commit 0b6bf86 into github:main Jul 23, 2026
14 checks passed
@mnriem

mnriem commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants